#ifndef LOGIN_H
#define LOGIN_H

#include <QDialog>
#include "common/common.h"

namespace Ui {
class Login;
}

class Login : public QDialog
{
    Q_OBJECT

public:
    explicit Login(QWidget *parent = 0);
    ~Login();

protected:
    void paintEvent(QPaintEvent *event) override;

public:
    QByteArray getRegJson(QString user, QString nick, QString pwd, QString phone, QString email);

    QByteArray getLoginJson(QString name, QString password);

    QStringList parseLoginJson(QByteArray json);

private slots:
    void on_server_set_btn_clicked();

    void on_register_btn_clicked();

    void on_login_btn_clicked();

private:
    Ui::Login *ui;

    Common m_cm;

    class MainWindow* p_main;
};

#endif // LOGIN_H
